// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 添加管理员权限 POST /admin/permission/insertAdminPermission */
export async function insertAdminPermissionUsingPOST(
  body: API.Permission,
  options?: { [key: string]: any },
) {
  return request<API.BaseResult>('/admin/permission/insertAdminPermission', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页查询权限权限 GET /admin/permission/pageQueryPermission */
export async function pageQueryPermissionUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.pageQueryPermissionUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResultPagePermission_>('/admin/permission/pageQueryPermission', {
    method: 'GET',
    params: {
      // currentPage has a default value: 1
      currentPage: '1',
      // pageSize has a default value: 10
      pageSize: '10',
      ...params,
    },
    ...(options || {}),
  });
}

/** 查询权限列表 GET /admin/permission/queryAllPermission */
export async function queryAllPermissionUsingGET(options?: { [key: string]: any }) {
  return request<API.BaseResultListPermission_>('/admin/permission/queryAllPermission', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 根据ID查询权限信息 GET /admin/permission/queryPermissionDetailInfo/${param0} */
export async function queryPermissionDetailInfoUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryPermissionDetailInfoUsingGETParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResultPermission_>(
    `/admin/permission/queryPermissionDetailInfo/${param0}`,
    {
      method: 'GET',
      params: { ...queryParams },
      ...(options || {}),
    },
  );
}

/** 删除管理员权限(可批量可单个) DELETE /admin/permission/removeAdminPermission */
export async function removeAdminPermissionUsingDELETE(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.removeAdminPermissionUsingDELETEParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResult>('/admin/permission/removeAdminPermission', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 修改权限信息 POST /admin/permission/updatePermissionInfo */
export async function updatePermissionInfoUsingPOST(
  body: API.Permission,
  options?: { [key: string]: any },
) {
  return request<API.BaseResult>('/admin/permission/updatePermissionInfo', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
